.TH REFLEX "1" "November 22, 2019" "reflex 1.5.4" "User Commands"
.SH NAME
reflex \- the regex\-centric fast and flexible lexical analyzer generator
.SH SYNOPSIS
.B reflex
[\fIOPTIONS\fR] [\fIFILE\fR]
.SH DESCRIPTION
Generates C++ source code programs that perform pattern\-matching on text.
\fIFILE\fR is a lexer specification source file, usually with extension .l.
Generates lex.yy.cpp unless option \fB-o\fR specifies otherwise.
.SH OPTIONS
.PP
.B Scanner:
.TP
  \fB\-+\fR, \fB\-\-flex\fR
generate Flex\-compatible C++ scanner
.TP
  \fB\-a\fR, \fB\-\-dotall\fR
dot in patterns match newline
.TP
  \fB\-B\fR, \fB\-\-batch\fR
generate scanner for batch input by buffering the entire input
.TP
  \fB\-f\fR, \fB\-\-full\fR
generate full scanner with FSM opcode tables
.TP
  \fB\-F\fR, \fB\-\-fast\fR
generate fast scanner with FSM code
.TP
  \fB\-i\fR, \fB\-\-case\-insensitive\fR
ignore case in patterns
.TP
  \fB\-I\fR, \fB\-\-interactive\fR, \fB\-\-always\-interactive\fR
generate interactive scanner
.TP
  \fB\-m\fR NAME, \fB\-\-matcher\fR=\fINAME\fR
use matcher NAME library [boost|boost_perl|reflex|std_ecma|...]
.TP
  \fB\-\-pattern\fR=\fINAME\fR
use custom pattern class NAME for custom matcher option \fB\-m\fR
.TP
  \fB\-\-include\fR=\fIFILE\fR
include header FILE.h for custom matcher option \fB\-m\fR
.TP
  \fB\-S\fR, \fB\-\-find\fR
generate search engine to find matches, ignores unmatched input
.TP
  \fB\-T\fR N, \fB\-\-tabs\fR=\fIN\fR
set default tab size to N (1,2,4,8) for indent/dedent matching
.TP
  \fB\-u\fR, \fB\-\-unicode\fR
match Unicode . (dot), \\p, \\s, \\w, etc and group UTF\-8 bytes
.TP
  \fB\-x\fR, \fB\-\-freespace\fR
ignore space in patterns
.PP
.B Generated files:
.TP
  \fB\-o\fR FILE, \fB\-\-outfile\fR=\fIFILE\fR
specify output FILE instead of lex.yy.cpp
.TP
  \fB\-t\fR, \fB\-\-stdout\fR
write scanner on stdout instead of lex.yy.cpp
.TP
  \fB\-\-graphs\-file\fR[=\fI\fR\fIFILE\fR]
write the scanner's DFA in Graphviz format to FILE.gv
.TP
  \fB\-\-header\-file\fR[=\fI\fR\fIFILE\fR]
write a C++ header FILE.h in addition to the scanner
.TP
  \fB\-\-regexp\-file\fR[=\fI\fR\fIFILE\fR]
write the scanner's regular expression patterns to FILE.txt
.TP
  \fB\-\-tables\-file\fR[=\fI\fR\fIFILE\fR]
write the scanner's FSM opcode tables or FSM code to FILE.cpp
.PP
.B Generated code:
.TP
  \fB\-\-namespace\fR=\fINAME\fR
use C++ namespace NAME for the generated scanner class, with
multiple namespaces specified as NAME1.NAME2.NAME3 ...
.TP
  \fB\-\-lexer\fR=\fINAME\fR
use lexer class NAME instead of Lexer or yyFlexLexer
.TP
  \fB\-\-lex\fR=\fINAME\fR
use lex function NAME instead of lex or yylex
.TP
  \fB\-\-class\fR=\fINAME\fR
declare a user\-defined scanner class NAME
.TP
  \fB\-\-yyclass\fR=\fINAME\fR
generate Flex\-compatible scanner with user\-defined class NAME
.TP
  \fB\-\-main\fR
generate main() to invoke lex() or yylex() once
.TP
  \fB\-L\fR, \fB\-\-noline\fR
suppress #line directives in scanner
.TP
  \fB\-P\fR NAME, \fB\-\-prefix\fR=\fINAME\fR
use NAME as prefix of the FlexLexer class name and its members
.TP
  \fB\-\-nostdinit\fR
initialize input to std::cin instead of stdin
.TP
  \fB\-\-bison\fR
generate global yylex() scanner for bison
.TP
  \fB\-\-bison\-bridge\fR
generate reentrant yylex() scanner for bison pure parser
.TP
  \fB\-\-bison\-cc\fR
generate bison C++ interface code for bison lalr1.cc skeleton
.TP
  \fB\-\-bison\-cc\-namespace\fR=\fINAME\fR
use namespace NAME with bison lalr1.cc skeleton
.TP
  \fB\-\-bison\-cc\-parser\fR=\fINAME\fR
use parser class NAME with bison lalr1.cc skeleton
.TP
  \fB\-\-bison\-complete\fR
use bison complete\-symbols feature, implies bison\-cc
.TP
  \fB\-\-bison\-locations\fR
include bison yylloc support
.TP
  \fB\-R\fR, \fB\-\-reentrant\fR
generate Flex\-compatible yylex() reentrant scanner functions
NOTE: adds functions only, reflex scanners are always reentrant
.TP
  \fB\-\-noyywrap\fR
do not call global yywrap() on EOF, requires option \fB\-\-flex\fR
.TP
  \fB\-\-exception\fR=\fIVALUE\fR
use exception VALUE to throw in the default rule of the scanner
.TP
  \fB\-\-token\-type\fR=\fINAME\fR
use NAME as the return type of lex() and yylex() instead of int
.PP
.B Debugging:
.TP
  \fB\-d\fR, \fB\-\-debug\fR
enable debug mode in scanner
.TP
  \fB\-p\fR, \fB\-\-perf\-report\fR
scanner reports detailed performance statistics to stderr
.TP
  \fB\-s\fR, \fB\-\-nodefault\fR
disable the default rule in scanner that echoes unmatched text
.TP
  \fB\-v\fR, \fB\-\-verbose\fR
report summary of scanner statistics to stdout
.TP
  \fB\-w\fR, \fB\-\-nowarn\fR
do not generate warnings
.PP
.B Miscellaneous:
.TP
  \fB\-c\fR, \fB\-n\fR
do\-nothing POSIX options
.TP
  \fB\-?\fR, \fB\-h\fR, \fB\-\-help\fR
produce this help message and exit
.TP
  \fB\-V\fR, \fB\-\-version\fR
report reflex version and exit
.PP
.B Lex/Flex\-like options that are enabled by default or have no effect:
.TP
  \fB\-\-c++\fR                  default
.TP
  \fB\-\-lex\-compat\fR           n/a
.TP
  \fB\-\-never\-interactive\fR    default
.TP
  \fB\-\-nounistd\fR             n/a
.TP
  \fB\-\-posix\fR                n/a
.TP
  \fB\-\-stack\fR                n/a
.TP
  \fB\-\-warn\fR                 default
.TP
  \fB\-\-yylineno\fR             default
.TP
  \fB\-\-yymore\fR               default
.TP
  \fB\-\-7bit\fR                 n/a
.TP
  \fB\-\-8bit\fR                 default
.SH DEPENDENCIES
None, except when option \fB-m\fR specifies an external pattern\-matcher engine
such as boost that requires the Boost.Regex library installed.
.SH "DOCUMENTATION"
The full documentation for \fBreflex\fR is maintained as a Doxygen\-generated
manual reflex/doc/html/index.html located in the source directory of the reflex
installation.  Or visit:
.IP
https://www.genivia.com/doc/reflex/html/index.html
.PP
to browse the reflex user guide.
.SH BUGS
REJECT is not functional and not available.
.PP
Report bugs at:
.IP
https://github.com/Genivia/RE-flex/issues
.SH LICENSE
\fBreflex\fR is released under the BSD\-3 license.  All parts of the software
have reasonable copyright terms permitting free redistribution.  This includes
the ability to reuse all or parts of the reflex source tree.
.SH "SEE ALSO"
lex(1), flex(1), flex++(1).
